package com.xbxkj.api.web.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import com.xbxkj.commen.bean.layuiBean.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;
import com.xbxkj.commen.controller.model.ResultModel;
import com.xbxkj.commen.bean.ShopShops;
import java.util.HashMap;
import java.util.List;
    import com.xbxkj.commen.controller.helper.V;
    import com.xbxkj.commen.controller.helper.X;
    import com.xbxkj.commen.controller.model.ResultModel;

import java.util.Map;
    import com.xbxkj.commen.controller.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2020-01-10
 */
@Controller("AdminShopShopsController")
@RequestMapping("/admin/shopShops")
public class ShopShopsController extends BaseController{
     /** 主页面 */
    @RequestMapping("main.html")
    public String main(){
       return  "shop/shop/shopShopsMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "/addShopShopsHtml")
    public String addShopShopsHtml( ){
             return "shop/shop/shopShopsAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/editShopShopsHtml")
    public String editShopShopsHtml(String id ,Model model ){
           model.addAttribute("shopShops",shopShopsService.selectShopShopsByIdShopShops(id));
             return "shop/shop/shopShopsEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/showShopShopsHtml")
    public String showShopShopsHtml(String id ,Model model ){
           model.addAttribute("shopShops",shopShopsService.selectShopShopsByIdShopShops(id));
             return "shop/shop/shopShopsShow";
    }


    /** 分页查询ShopShops
     * @param page  页码
     * @param limit  查几条
     * @param shopShops  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "/findShopShopsByPage")
    @ResponseBody
    public ResultPage findShopShopsByPage(Integer page, Integer limit,ShopShops shopShops){
             return shopShopsService.findShopShopsByPage(page,limit,shopShops);
    }

    /** 添加ShopShops
     * @param shopShops  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/addShopShops")
    @ResponseBody
    public ResultModel<?> saveShopShops(ShopShops shopShops  ){
             return shopShopsService.addShopShops(shopShops);
    }

    /** 编辑ShopShops
     * @param shopShops  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/editShopShops")
    @ResponseBody
    public ResultModel<?> editShopShops(ShopShops shopShops  ){
             return shopShopsService.editShopShops(shopShops);
    }



    /** 删除一条ShopShops
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "/delShopShops")
    @ResponseBody
    public ResultModel<?> delShopShops( String id  ){
             return shopShopsService.delShopShops(id);
    }


}
